<extend name="Layout/ins_popup" />
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">
	<select name="dept_list" id="dept_list" class="hidden">
		{:fill_option($dept_list)}
	</select>
	<div class="popup-header clearfix">
		<div class="pull-left">
			<h1>添加员工</h1>
		</div>
		<div class="pull-right">
			<a onclick="save();" class="btn btn-sm btn-primary">确定</a>
			<a onclick="myclose();" class="btn btn-sm btn-default">关闭</a>
		</div>
	</div>
	<div class="popup-body" style="height: 420px;overflow-y: auto;">
		<form id="form_data" name="form_data" method="post" class="form-horizontal">
			<input type="hidden" name="opmode" id="opmode" value="add">
			<table class="table table-bordered" >
				<tr>
					<th class="col-10">
					<nobr>
						员工编号*
					</nobr></th>
					<td class="col-20">
					<input class="form-control" type="text" id="emp_no" name="emp_no"  check="require" msg="请输入员工编号">
					</td>
					<th  class="col-5">姓名*</th>
					<td class="col-20">
					<input  class="form-control" type="text" id="name" name="name" class="input-sm" check="require" msg="请输入姓名">
					</td>

				</tr>
				<tr>
					<th  class="col-10">昵称*</th>
					<td class="col-10">
					<input  class="form-control" type="text" id="nickname" name="nickname" class="input-sm" check="require" msg="请输入昵称">
					</td>
				</tr>
				<tr>
					<th>性别</th>
					<td >
					<select name="sex" id="sex" class="form-control col-10">
						<option  value="male">男</option>
						<option value="female">女</option>
					</select></td>
					<th>生日</th>
					<td style="position: relative" >
					<input type="text" id="birthday" name="birthday" readonly="readonly" class="input-date form-control" readonly="readonly">
					</td>
				</tr>
				<tr>
					<th>部门*</th>
					<td class="col-20">
					<div class="input-group ">
						<input class="form-control" name="dept_name"  id="dept_name" type="text" msg="请选择部门" check="require" readonly="readonly" />
						<input name="dept_id" id="dept_id" type="hidden" msg="请选择部门" check="require" />
						<div class="input-group-btn">
							<a class="btn btn-sm btn-primary" onclick="select_dept();" > <i class="fa fa-search" ></i> </a>
						</div>
					</div></td>
					<th class="col-10">职位*</th>
					<td>
					<select name="position_id" id="position_id" class="form-control" msg="请选择职位" check="require">
						<option value="">选择职位</option>
						{:fill_option($position_list)}
					</select></td>
				</tr>
				<tr>
					<th>
					<nobr>
						办公室电话
					</nobr></th>
					<td>
					<input type="text" id="office_tel" name="office_tel" class="form-control">
					</td>
					<th>
					<nobr>
						移动电话
					</nobr></th>
					<td>
					<input type="text" id="mobile_tel" name="mobile_tel" class="form-control">
					</td>
				</tr>
				<tr>
				<tr>
					<th>电子邮箱</th>
					<td colspan="3">
					<input type="text" id="email" name="email" class="form-control">
					</td>
				</tr>
				<tr>
					<th>
					<nobr>
						负责业务
					</nobr></th>
					<td colspan="3">
					<input type="text" id="duty" name="duty" class="form-control">
					</td>
				</tr>
				<tr>
					<th>状态</th>
					<td colspan="3">
					<select class="form-control col-10"  name="is_del" id="is_del">
						<option  value="0">启用</option>
						<option value="1">禁用</option>
					</select></td>
				</tr>
			</table>
		</form>
	</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		function select_dept() {
			winopen("{:U('dept/winpop2')}", 560, 470);
		}

		function save() {
			if (check_form("form_data")) {
				var vars = $("#form_data").serialize();
				sendAjax("{:U('save')}", vars, function(data) {
					if (data.status) {
						ui_alert(data.info, function() {
							parent.location.reload(true);
							myclose();
						});
					} else {
						ui_error(data.info);
					}
				});
			}
		}
	</script>
</block>